package com.fare.taluo.core.domain.queue.message.repository.impl;

import java.util.Date;
import java.util.List;

import org.springframework.stereotype.Repository;

import com.dayatang.domain.QuerySettings;
import com.dayatang.hibernate.EntityRepositoryHibernate;
import com.fare.taluo.core.domain.queue.message.QueueSMSMessageEntity;
import com.fare.taluo.core.domain.queue.message.repository.QueueSMSMessageRepository;
import com.foreveross.threadpool.queue.WorkQueue;
@Repository
public class QueueSMSMessageRepositoryImpl extends EntityRepositoryHibernate
		implements QueueSMSMessageRepository{
	
	public List<QueueSMSMessageEntity> listPlanStartEntity(int maxSize){
		return super.find(QuerySettings.create(QueueSMSMessageEntity.class).lt("planStartTime", new Date())
				.eq("status", WorkQueue.STATUS_WAITING).asc("createTime").setMaxResults(maxSize));
	}
}
